package com.asl.website.serviceNeed.service.impl;

import java.util.List;
import com.asl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.asl.website.serviceNeed.mapper.SysServiceNeedMapper;
import com.asl.website.serviceNeed.domain.SysServiceNeed;
import com.asl.website.serviceNeed.service.ISysServiceNeedService;

/**
 * 需求服务Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class SysServiceNeedServiceImpl implements ISysServiceNeedService 
{
    @Autowired
    private SysServiceNeedMapper sysServiceNeedMapper;

    /**
     * 查询需求服务
     * 
     * @param serviceId 需求服务主键
     * @return 需求服务
     */
    @Override
    public SysServiceNeed selectSysServiceNeedByServiceId(Long serviceId)
    {
        return sysServiceNeedMapper.selectSysServiceNeedByServiceId(serviceId);
    }

    /**
     * 查询需求服务列表
     * 
     * @param sysServiceNeed 需求服务
     * @return 需求服务
     */
    @Override
    public List<SysServiceNeed> selectSysServiceNeedList(SysServiceNeed sysServiceNeed)
    {
        return sysServiceNeedMapper.selectSysServiceNeedList(sysServiceNeed);
    }

    /**
     * 新增需求服务
     * 
     * @param sysServiceNeed 需求服务
     * @return 结果
     */
    @Override
    public int insertSysServiceNeed(SysServiceNeed sysServiceNeed)
    {
        sysServiceNeed.setCreateTime(DateUtils.getNowDate());
        return sysServiceNeedMapper.insertSysServiceNeed(sysServiceNeed);
    }

    /**
     * 修改需求服务
     * 
     * @param sysServiceNeed 需求服务
     * @return 结果
     */
    @Override
    public int updateSysServiceNeed(SysServiceNeed sysServiceNeed)
    {
        sysServiceNeed.setUpdateTime(DateUtils.getNowDate());
        return sysServiceNeedMapper.updateSysServiceNeed(sysServiceNeed);
    }

    /**
     * 批量删除需求服务
     * 
     * @param serviceIds 需要删除的需求服务主键
     * @return 结果
     */
    @Override
    public int deleteSysServiceNeedByServiceIds(Long[] serviceIds)
    {
        return sysServiceNeedMapper.deleteSysServiceNeedByServiceIds(serviceIds);
    }

    /**
     * 删除需求服务信息
     * 
     * @param serviceId 需求服务主键
     * @return 结果
     */
    @Override
    public int deleteSysServiceNeedByServiceId(Long serviceId)
    {
        return sysServiceNeedMapper.deleteSysServiceNeedByServiceId(serviceId);
    }
}
